import Koa from 'koa'
import compose from 'koa-compose'
import koaBody from 'koa-body'
import jwt from 'koa-jwt'
import helmet from 'koa-helmet'
import routers from './routers/routers'

const app = new Koa();

app.use(compose([
    koaBody(),
    jwt({secret: 'shared-secret'}).unless({path: [/^\/public/, /^\/login/]}),
    helmet(),
    routers()
]))

app.listen(8888);